home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2003 September / PC Answers September 2003.iso / Software / trial / AutoMate 5.0.4.1 / automate5_eval_setup.exe / Open_Notepad_and_Send_Keystrokes.aml < prev    next >
Encoding:
Text File  |  2002-05-13  |  2.2 KB  |  52 lines

  1. <AM5TASK>
  2. <AMTASKHEAD>
  3.     <TASKINFO TASKNAME="">
  4. <\AMTASKHEAD>
  5. <STEPS>
  6. <!---       Show message box telling the user what is going on --->
  7. <AMMESSAGEBOX WINDOWTITLE="Sample Task" BUTTONS="ok_cancel" ICON="information" ONSECONDBUTTONCLICK="stop">This sample task demonstrates:
  8. 1) Runing a program
  9. 2) Sending keystrokes
  10. 3) Moving the mouse 
  11. 4) Looping
  12. 5) IF action
  13.  
  14. and other neat tricks.  
  15.  
  16. It is designed to show AutoMate functionality in use.  Remember you can always stop a task in progress by pressing CTRL-ALT-END. Press okay to continue running the task or Cancel to stop now.</AMMESSAGEBOX>
  17. <!---      Create the variable that will be used to store move mouse 
  18. loop count for use in move mouse action --->
  19. <AMVARIABLE NAME="movecoordinates"></AMVARIABLE>
  20. <!---       Start notepad --->
  21. <AMRUN FILE="NOTEPAD.EXE ">
  22. <!---       Begin sending text to notepad, set to prevent user from 
  23. changing windows --->
  24. <AMSENDKEY METHOD="paste" LOCKKEYBOARD="YES">Welcome to AutoMate, the leading system automation platform for Windows.  As you can see, one of the many things AutoMate can do send text to application windows.  
  25. </AMSENDKEY>
  26. <AMSENDKEY>
  27. Keystrokes can also be sent one by one like this.
  28. </AMSENDKEY>
  29. <AMSENDKEY METHOD="paste" LOCKKEYBOARD="YES">
  30. AutoMate can also move the mouse, like this...</AMSENDKEY>
  31. <!---       Prevent user from moving mouse and begini a loop which 
  32. increments a number that will be used for X and Y 
  33. coordinates when moving the mouse. --->
  34. <AMBLOCKINPUT>
  35. <AMLOOP FROM="1" TO="300" RESULTVARIABLE="movecoordinates" STEP="10">
  36.           <AMMOUSEMOVE MOVEX="0%movecoordinates%" MOVEY="%movecoordinates%">
  37. </AMLOOP>
  38. <!---       Give control back to user. --->
  39. <AMBLOCKINPUT ACTION="unlock">
  40. <AMSENDKEY METHOD="paste" LOCKKEYBOARD="YES">
  41. And manipulate application windows like this...
  42. </AMSENDKEY>
  43. <!---       Play with the open window - could reference window by 
  44. handle also but instead used title for readability. --->
  45. <AMWINDOWMAXIMIZE WINDOWTITLE="Untitled - Notepad">
  46. <AMWINDOWRESTORE WINDOWTITLE="Untitled - Notepad">
  47. <AMSENDKEY METHOD="paste" LOCKKEYBOARD="YES">This is just the beginning, double click this task and select "Edit Steps" to see how it works.
  48.  
  49. Enjoy!</AMSENDKEY>
  50. <\STEPS>
  51. </AM5TASK>
  52.